/**
 * Created by ZE-C on 2017/8/12.
 */
import {Component} from "@angular/core";
import {Router} from "@angular/router";

/**
 * Created by ZE-C on 2017/8/12.
 */


@Component({
  selector: 'page2',
  template: `
    <div class="z-box">
      page2
      <button (click)="gotoSubpage()">go to sub page</button>
    </div>
  `,
  styleUrls: []
})
export class Page2Component {
  name: string;

  constructor(private router: Router){

  }

  ngOnDestroy(): void {
    console.log('page2: OnDestroy()')
  }

  gotoSubpage(){
    this.router.navigate(['subpage2'])
  }
}
